<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <title>01_css中常用的长度单位</title>
    <style>
        html {
            font-size: 200px;
        }
        #d1 {
            width: 200px;
            height: 200px;
            font-size: 100px;
            background-color: aqua;
        }

        /* em相对于当前元素或父元素font-size的2倍 */
        #d2 {
            width: 2em;
            height: 2em;
            /* font-size: 150px; */
            background-color: aquamarine;
        }

        #d3 {
            width: 2rem;
            height: 2rem;
            /* font-size: 150px; */
            background-color:blueviolet;
        }
        #d4{
            width: 2rem;
            height: 2rem;
            font-size: 150px;
            background-color:rgb(226, 43, 86);
        }
        .inside {
            width: 25%;
            height: 50%;
            font-size: 50%;
            background-color:rgb(222, 228, 50);
        }
        .work {
            font-size: 50px;
            text-indent: 2em;
        }
    </style>
</head>

<body style="font-size:100px;">
    <div id="d1">1</div>
    <div id="d2">2</div>
    <div id="d3">3</div>
    <div id="d4">
        <div class="inside">4</div>
    </div>

    <div class="work">好好学习，天天向上！</div>
</body>

</html>